import axios from '@/libs/request/axios'
import QS from 'qs';

//查询银行对公结算案件
export const queryCorporateList = (params) => {
    return axios.request({
        url: `/apply/corporateTransManagement/queryCorporateList`,
        params: params,
        method: 'post'
    })
}
//删除对公结算案件
export const deleteCorporateTransfer = (id) => {
    return axios.request({
        url: `/apply/corporateTransManagement/deleteCorporateTransfer`,
        data: QS.stringify({id: id}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
}
//根据案件编号查询对公结算案件详情
export const queryCorporateByCaseNo = (caseNo) => {
    return axios.request({
        url: `/apply/corporateTransManagement/queryCorporateByCaseNo`,
        data: QS.stringify({caseNo: caseNo}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
}
//对公结算相关合同信息查询
export const contractInfoForCorporate = (contractNo) => {
    return axios.request({
        url: `/apply/corporateTransManagement/contractInfoForCorporate`,
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
}
//对公勾稽案件信息保存
export const saveCorporate = (params) => {
    return axios.request({
        url: `/apply/corporateTransManagement/saveCorporate`,
        data: params,
        method: 'post'
    })
}
//对公勾稽案件信息提交
export const submitCorporate = (params) => {
    return axios.request({
        url: `/apply/corporateTransManagement/submitCorporate`,
        data: params,
        method: 'post'
    })
}

/**
 * 获取影像件数据
 * @param params
 * @returns {*}
 */
export const getComAttach = (params) => {
    return axios.request({
        url: `/apply/applyComAttach/getComAttachForContract`,
        data: params,
        method: 'post'
    })
}

/**
 * 合同模板批量打印
 * @param params
 * @returns {*}
 */
export const contractBatchPrint = (params) => {
    return axios.request({
        url: `/apply/applyComAttach/contractBatchPrint`,
        data: params,
        method: 'post'
    })
}
/**
 * 进件申请书生成
 * @param params
 * @returns {*}
 */
export const applyBatchPrint = (params) => {
    return axios.request({
        url: `/apply/applyComAttach/applyBatchPrint`,
        data: params,
        method: 'post'
    })
}
/**
 * 单个文件下载
 * @param params
 * @returns {*}
 */
export const downloadSingleFile = (params) => {
    return axios.request({
        url: `/apply/applyComAttach/downloadSingleFile`,
        data: params,
        method: 'post',
        responseType: "blob"
    })

}
/**
 * 批量下载
 * @param params
 * @returns {*}
 */
export const downloadBatchFile = (params) => {
    return axios.request({
        url: `/apply/applyComAttach/downloadBatchFile`,
        data: params,
        method: 'post',
        responseType: "blob"
    })
}

